package com.probiz.estore.exports.handler.salesOrder;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;

import com.probiz.estore.common.model.order.OrderSku;
import com.probiz.estore.common.model.order.SalesOrder;
import com.probiz.estore.exports.handler.ColumnHandler;
import com.probiz.estore.exports.model.Column;

public class GcsHandler implements ColumnHandler {

	public String getProperty(Object target, Column column, HSSFSheet sheet,
			HSSFRow row, List<String> listHeader) {
		SalesOrder salesOrder = (SalesOrder) target;
		List<OrderSku> orderSkus = salesOrder.getOrderSkus4Gc();
		StringBuffer sb = new StringBuffer("");
		for (OrderSku orderSku : orderSkus) {
			sb.append(orderSku.getGiftCertificate().getGiftCertificateNo()).append(" ").append(orderSku.getPrice()).append(" X ").append(orderSku.getQuantity()).append(";");
		}
		return sb.toString();
	}

}
